<?php

$element = $this->element;

$attribs = $element->getAttribs();
$label = $element->getLabel();

$messages = $element->getMessages();

if(empty($messages)){
    $error = "";
}else{
    foreach ($messages as $err){
        $error[] = $err;
    }
}

$attribs['escape'] = false;
$attribs['class'] = '';
$label = $this->escape($label); ?>
<fieldset>
<?php
    if ($element->isRequired()) {
        echo $this->formLabel($element->getName(), $label, $attribs);
    } else {
        echo $this->formLabel($element->getName(), $label, $attribs);
    }
    echo $this->content;
    echo "<br><br>";
    if (!empty($error))
    {
        foreach ($error as $err ){
            echo $this->partial('/partials/message.phtml',array(
                        'message' => $err,
                        'messageType' => "error"
             ));
        }
    }
    ?>

</fieldset>